home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PRINTER / DJPRINT.ARJ / DJPRINT.ASC next >
Text File  |  1992-03-25  |  9KB  |  181 lines

  1. Geneva, March 25th 1992.
  2.  
  3.       Djprint is a small utility your paper account  will
  4. be grateful for. If you own a HP Deskjet printer you will
  5. be  able  to print on both sides of a sheet of paper  and
  6. thus  squeeze  4  pages of text on a  single  sheet.  The
  7. printer is set in landscape mode and uses the standard 20
  8. cpi  courier font. Each side is divided in two 108-column
  9. wide  pages. The left and right pages are separated by  a
  10. vertical  line. In addition, you have many  options  like
  11. margins  setting,  headers and footers,  line  numbering,
  12. line truncation or wrap-around, and frames.
  13.       Djprint  is  invoked on the command line  with  the
  14. following syntax:
  15. djprint [/t] [/pn] [/TABnn]
  16.      [/TMnn] [/BMnn] [/LMnn] [/RMnn]
  17.      [/LH="string"] [/RH="string"] [/BH="string"]
  18.      [/LF="string"] [/RF="string"] [/BF="string"]
  19.      [/MH="string"] [/MF="string"]
  20.      [/AN | /RN]
  21.      [/BR1 | /BR2 | /BR3 /BR4]
  22.      [@paramfile]
  23.      {filename} [>lpt1|outputfile]
  24.  
  25.       The  switches between square brackets are optional.
  26. The output is sent onto the screen by default and must be
  27. redirected to the printer for real printing.
  28. /t  stands  for  line truncation. Lines longer  than  108
  29. characters are truncated. By default, they are  continued
  30. on the next line without truncation.
  31. /pn, where n is equal to 2 or 4, specifies the number  of
  32. pages  per  sheet, default is 4. So, if /p2  is  selected
  33. then  only  one side of the sheet is printed.  If  /p  is
  34. missing then both sides are used;
  35. /TABnn  allows  to select the number of spaces  TABs  are
  36. expanded  in,  default  is  8; besides  TABs,  form  feed
  37. characters (ASCII 12) are interpreted as expected;  other
  38. control  characters  may have unpredictable  effects,  so
  39. check  that  you print only text files (or at least  pass
  40. them  though a filter, for example an AWK script,  before
  41. submitting them to Djprint).
  42. [/TMnn] sets the top margin to nn lines, ie nn lines  are
  43. skipped  before  the  first line of  text  gets  printed;
  44. default is 0;
  45. [/BMnn]  sets  the bottom margin, ie nn  lines  are  left
  46. blank at the bottom of both pages; default is 0;
  47. [/LMnn]  sets  the  left margin to nn characters,  ie  nn
  48. spaces  are  printed before the first character  of  each
  49. line; default is 0;
  50. [/RMnn]  sets  the right margin to nn characters,  ie  nn
  51. spaces  are reserved at the end of each line; default  is
  52. 0;
  53. The  above  margin  settings apply to each  side  of  the
  54. sheet.
  55. [/LH="string"] sets the left page header to "string";
  56. [/RH="string"] sets the right page header to "string";
  57. [/BH="string"] sets both the left and right page  headers
  58. to the same string "string";
  59. [/LF="string"] sets the left page footer to "string";
  60. [/RF="string"] sets the right page footer to "string";
  61. [/BF="string"] sets both the left and right page  footers
  62. to the same string "string";
  63. [/MH="string"]  sets the main header  to  "string";  this
  64. header, if present, is the first line of text printed and
  65. applies to both side's pages;
  66. [/MF="string"]  sets the main footer to  "string";   this
  67. footer, if present, is the last line of text printed  and
  68. applies to both side's pages;
  69. Unlike  the  main header and main footer, the above  left
  70. and  right  headers and footers apply to their respective
  71. page on each side;
  72. Do  not  forget to bracket the strings between two double
  73. quotes or else the parser will return strange things !
  74. [/AN  |  /RN] allow line numbering and are exclusive.  If
  75. /AN  is selected an absolute line numbering is performed,
  76. ie the lines are sequentially numbered from 1 to the last
  77. file's line. If /RN is given a relative line numbering is
  78. performed, ie the lines are sequentially numbered from  1
  79. to  the last line of the page and the counter is reset to
  80. 1 at the beginning of the next page. This allows to index
  81. a  line in a file by respectively its absolute number  or
  82. its page number and its relative line number.
  83. [/BR1 | /BR2 | /BR3 /BR4] sets the sheets' border (frame)
  84. type,  by  default there is no border around the  printed
  85. text.
  86. /BR1 sets the border to a single line frame;
  87. /BR2 sets the border to a double line frame;
  88. /BR3  sets  the  border to a single horizontal  line  and
  89. double vertical line frame;
  90. /BR4  sets the border to a double horizontal line  and  a
  91. single vertical line frame.
  92. [@paramfile]  tells the parser to look in file  paramfile
  93. for  its  parameters. This is needed because the  command
  94. line length is limited to 128 characters which is quickly
  95. reached  when multiple headers/footers and/or  files  are
  96. given.  The  command  line  is  still  parsed  for  other
  97. options, which may override the ones in the command file.
  98. See below for a description of this file's format.
  99. {filename}  is  a list of files to print,  wildcards  are
  100. accepted.   The  file  names  follow  the  standard   DOS
  101. convention (ie, [drive:][path]filename[.extension]).
  102. [>lptn|outputfile] redirects the output  to  the  printer
  103. port  n  or to a disk file. By default output is sent  to
  104. the screen.
  105.       Switches  may be entered in either upper  or  lower
  106. cases  and in whatever order you want. When no parameters
  107. are  given Djprint displays a help screen with a  summary
  108. of  all the options above. When exclusive parameters  are
  109. given  many  times  or the same switches  are  used  with
  110. different  parameters the most recent ones are  effective
  111. and  override  the previous ones. In order  to  keep  the
  112. parsing  simple  no  error  messages  are  displayed  and
  113. invalid switches are ignored.
  114.       If  /p4 is given the printing is performed  in  two
  115. passes,  the first one prints pages 1 and 2, 5 and  6,  9
  116. and 10, and so on. The second pass prints pages 3 and  4,
  117. 7  and  8, 11 and 12, and so on. Between the passes,  the
  118. stack  of  printed paper must be put again in  the  paper
  119. tray  WITHOUT  changing its order (ie, the printed  sides
  120. up) and after the printer has emptied its buffer. Djprint
  121. displays  an appropriate message when the first pass  has
  122. completed. If the pages are to be bound together like  in
  123. a book, it is suggested to rotate (but not turn over) the
  124. stack  180  degrees. This will allow to  read  the  pages
  125. without one wrenching his neck. As /p4 interacts with the
  126. user,  output should be redirected to the printer  (>lptx
  127. or  prn)  otherwise,  if you print the  redirection  file
  128. later,  you will not be warned about the second pass.  So
  129. remember,  you should use /p2 if you redirect the  output
  130. to  a  disk  file.  If you use /p4 the output  should  be
  131. redirected to the printer.
  132.      If you have Buerg's List utility, you can experiment
  133. with Djprint in the following way. Type:
  134.      djprint [your options and file names] | list/s.
  135. This  will pipe Djprint's output to List which will  then
  136. let  you  browse through it on the screen. When  you  are
  137. satisfied with the parameters you can redirect the output
  138. to the printer.
  139.       The optional command file has the following format:
  140. each  parameter  must be given on  a  line  of  its  own,
  141. without '/' switch. For example:
  142.      djprint @cmdfile >prn
  143. where cmdfile contains the lines below:
  144.      mh="Project SOCKETS"
  145.      mf="Winter 91-92"
  146.      an
  147.      tm3
  148.      *.mod *.def *.c
  149.      *.txt *.doc
  150. This is functionnally equivalent to:
  151.      djprint /mh="Project SOCKETS" /mf="Winter 91-92" /an
  152. /tm3 *.mod *.def *.c *.txt *.doc >prn
  153. but  is much easier to edit. Note how the options on  the
  154. command line are preceded by a '/' but not in the command
  155. file.
  156.       As  of  today I've printed about 300 pages of  text
  157. with  this program but, according to Murphy's laws,  bugs
  158. are  certainly  still  sitting around  waiting  for  that
  159. large, essential document to mess up in the most critical
  160. time.  So,  if you find one bug or want some new  feature
  161. added send me a mail at the address below.
  162.       This program was written in Logitech Modula-2 under
  163. MS-DOS  (but  should  be  ported  very  easily  to  OS/2,
  164. provided  that  OS/2  has  the  driver  for  the  Deskjet
  165. printer...)  as a by-product of a university CS  project.
  166. As  such  it  may need some refurbishment for  example  a
  167. better  user interface, a table of content when  multiple
  168. files  are  printed  at  once, matrix  printers  support,
  169. better  parsing,  etc... Nonetheless, I would  very  much
  170. appreciate a not so symbolic donation of 10$ to encourage
  171. any further improvement. However, if you can't afford it,
  172. it's all right, enjoy it anyway !
  173.  
  174. Cesare Cervini
  175. 29, avenue Dumas
  176. CH-1206 Geneva
  177. Switzerland
  178. BIX: ccesare
  179. Internet: cervini@eldi.epfl.ch
  180.  
  181.